#pragma once

#include <vector>
#include <cstdint>
#include <cmath>

namespace jvm {
namespace heap {

class Object;

struct Slot {
    int32_t num;
    Object* pRef;

    Slot() : num(0), pRef(nullptr) {}
};

class Slots {
private:
    std::vector<Slot> m_slots;

public:
    Slots(uint slotCount);
    
    // Primitive type operations
    void setInt(uint index, int32_t val);
    int32_t getInt(uint index) const;
    
    void setFloat(uint index, float val);
    float getFloat(uint index) const;
    
    void setLong(uint index, int64_t val);
    int64_t getLong(uint index) const;
    
    void setDouble(uint index, double val);
    double getDouble(uint index) const;
    
    // Reference type operations
    void setRef(uint index, Object* pRef);
    Object* getRef(uint index) const;
};

} // namespace heap
} // namespace jvm
